<template>

  <div class="test-scss">

    <span class="test-scss-main"></span>
    <div class="contain">
      <span class="item-1"></span>
      <span class="item-2"></span>
      <span class="item-3"></span>
      <span class="item-4"></span>

    </div>
    <router-link to="test">点击</router-link>
  </div>
</template>

<script>
  export default {
    name: "test-scss"
  }
</script>

<style lang="scss" scoped>
  $width: 100px;
  $height: 50px;
  .test-scss {
    width: 100%;
    height: 100%;
    &-main {
      width: $width;
      height: $height;
      display: block;
      background-color: red;
    }
    $name: 'contain';
    .#{$name} {
      @extend .test-scss-main;

      $i: 6;
      @while $i>0 {
        .item-#{$i} {
          width: 100px * $i;
          height: 10px + $i;
          background-color: #45b795;
          display: block;
          float: left;
        }

        $i: $i - 1;
      }







    }
    @mixin link-color($color,$hover,$visit){

      color: $color;
      &:hover{color: $hover;background-color:$hover;}
      &:visited{color: $visit;background-color:$visit;}
    }
    a{
      width: 100px;
      display: block;
      margin-top: 100px;
      @include link-color(red,blue,black);
    }



  }
</style>
